Name:       meson
Version:    0.62.0
Release:    1
Summary:    High productivity build system
License:    Apache
Requires:   ninja

BuildRequires: python3

Source: https://github.com/mesonbuild/meson/releases/download/%{version}/meson-%{version}.tar.gz

%global pyver 3.9

%description
High productivity build system

%prep
%setup -q

%build
python3 setup.py build

%install
python3 setup.py install --root="%{buildroot}" --optimize=1 --skip-build

install -d "%{buildroot}/usr/share/vim/vimfiles"
cp -rt "%{buildroot}/usr/share/vim/vimfiles" data/syntax-highlighting/vim/*/

install -d "%{buildroot}/usr/share/bash-completion/completions"
cp data/shell-completions/bash/* "%{buildroot}/usr/share/bash-completion/completions/"
install -d "%{buildroot}/usr/share/zsh/site-functions"
cp data/shell-completions/zsh/* "%{buildroot}/usr/share/zsh/site-functions"


%files
%license COPYING
/usr/bin/meson
/usr/lib/python%{pyver}/site-packages/meson-%{version}-py%{pyver}.egg-info
/usr/lib/python%{pyver}/site-packages/mesonbuild
/usr/share/bash-completion/completions/meson
/usr/share/man/man1/meson.*
/usr/share/vim/vimfiles/ftdetect/meson.vim
/usr/share/vim/vimfiles/ftplugin/meson.vim
/usr/share/vim/vimfiles/indent/meson.vim
/usr/share/vim/vimfiles/syntax/meson.vim
/usr/share/zsh/site-functions/_meson
/usr/share/polkit-1/actions/com.mesonbuild.install.policy

%changelog
# let's skip this for now
